//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if compiler(>=5.5.2) && canImport(_Concurrency)

import SotoCore

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension MigrationHubOrchestrator {
    // MARK: Async API Calls

    /// Create a workflow to orchestrate your migrations.
    public func createWorkflow(_ input: CreateMigrationWorkflowRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> CreateMigrationWorkflowResponse {
        return try await self.client.execute(operation: "CreateWorkflow", path: "/migrationworkflow/", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Create a step in the migration workflow.
    public func createWorkflowStep(_ input: CreateWorkflowStepRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> CreateWorkflowStepResponse {
        return try await self.client.execute(operation: "CreateWorkflowStep", path: "/workflowstep", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Create a step group in a migration workflow.
    public func createWorkflowStepGroup(_ input: CreateWorkflowStepGroupRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> CreateWorkflowStepGroupResponse {
        return try await self.client.execute(operation: "CreateWorkflowStepGroup", path: "/workflowstepgroups", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Delete a migration workflow. You must pause a running workflow in Migration Hub Orchestrator console to delete it.
    public func deleteWorkflow(_ input: DeleteMigrationWorkflowRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> DeleteMigrationWorkflowResponse {
        return try await self.client.execute(operation: "DeleteWorkflow", path: "/migrationworkflow/{id}", httpMethod: .DELETE, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Delete a step in a migration workflow. Pause the workflow to delete a running step.
    public func deleteWorkflowStep(_ input: DeleteWorkflowStepRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> DeleteWorkflowStepResponse {
        return try await self.client.execute(operation: "DeleteWorkflowStep", path: "/workflowstep/{id}", httpMethod: .DELETE, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Delete a step group in a migration workflow.
    public func deleteWorkflowStepGroup(_ input: DeleteWorkflowStepGroupRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> DeleteWorkflowStepGroupResponse {
        return try await self.client.execute(operation: "DeleteWorkflowStepGroup", path: "/workflowstepgroup/{id}", httpMethod: .DELETE, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Get the template you want to use for creating a migration workflow.
    public func getTemplate(_ input: GetMigrationWorkflowTemplateRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> GetMigrationWorkflowTemplateResponse {
        return try await self.client.execute(operation: "GetTemplate", path: "/migrationworkflowtemplate/{id}", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Get a specific step in a template.
    public func getTemplateStep(_ input: GetTemplateStepRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> GetTemplateStepResponse {
        return try await self.client.execute(operation: "GetTemplateStep", path: "/templatestep/{id}", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Get a step group in a template.
    public func getTemplateStepGroup(_ input: GetTemplateStepGroupRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> GetTemplateStepGroupResponse {
        return try await self.client.execute(operation: "GetTemplateStepGroup", path: "/templates/{templateId}/stepgroups/{id}", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Get migration workflow.
    public func getWorkflow(_ input: GetMigrationWorkflowRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> GetMigrationWorkflowResponse {
        return try await self.client.execute(operation: "GetWorkflow", path: "/migrationworkflow/{id}", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Get a step in the migration workflow.
    public func getWorkflowStep(_ input: GetWorkflowStepRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> GetWorkflowStepResponse {
        return try await self.client.execute(operation: "GetWorkflowStep", path: "/workflowstep/{id}", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Get the step group of a migration workflow.
    public func getWorkflowStepGroup(_ input: GetWorkflowStepGroupRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> GetWorkflowStepGroupResponse {
        return try await self.client.execute(operation: "GetWorkflowStepGroup", path: "/workflowstepgroup/{id}", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// List AWS Migration Hub Orchestrator plugins.
    public func listPlugins(_ input: ListPluginsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListPluginsResponse {
        return try await self.client.execute(operation: "ListPlugins", path: "/plugins", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// List the tags added to a resource.
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListTagsForResourceResponse {
        return try await self.client.execute(operation: "ListTagsForResource", path: "/tags/{resourceArn}", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// List the step groups in a template.
    public func listTemplateStepGroups(_ input: ListTemplateStepGroupsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListTemplateStepGroupsResponse {
        return try await self.client.execute(operation: "ListTemplateStepGroups", path: "/templatestepgroups/{templateId}", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// List the steps in a template.
    public func listTemplateSteps(_ input: ListTemplateStepsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListTemplateStepsResponse {
        return try await self.client.execute(operation: "ListTemplateSteps", path: "/templatesteps", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// List the templates available in Migration Hub Orchestrator to create a migration workflow.
    public func listTemplates(_ input: ListMigrationWorkflowTemplatesRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListMigrationWorkflowTemplatesResponse {
        return try await self.client.execute(operation: "ListTemplates", path: "/migrationworkflowtemplates", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// List the step groups in a migration workflow.
    public func listWorkflowStepGroups(_ input: ListWorkflowStepGroupsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListWorkflowStepGroupsResponse {
        return try await self.client.execute(operation: "ListWorkflowStepGroups", path: "/workflowstepgroups", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// List the steps in a workflow.
    public func listWorkflowSteps(_ input: ListWorkflowStepsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListWorkflowStepsResponse {
        return try await self.client.execute(operation: "ListWorkflowSteps", path: "/workflow/{workflowId}/workflowstepgroups/{stepGroupId}/workflowsteps", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// List the migration workflows.
    public func listWorkflows(_ input: ListMigrationWorkflowsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListMigrationWorkflowsResponse {
        return try await self.client.execute(operation: "ListWorkflows", path: "/migrationworkflows", httpMethod: .GET, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Retry a failed step in a migration workflow.
    public func retryWorkflowStep(_ input: RetryWorkflowStepRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> RetryWorkflowStepResponse {
        return try await self.client.execute(operation: "RetryWorkflowStep", path: "/retryworkflowstep/{id}", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Start a migration workflow.
    public func startWorkflow(_ input: StartMigrationWorkflowRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> StartMigrationWorkflowResponse {
        return try await self.client.execute(operation: "StartWorkflow", path: "/migrationworkflow/{id}/start", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Stop an ongoing migration workflow.
    public func stopWorkflow(_ input: StopMigrationWorkflowRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> StopMigrationWorkflowResponse {
        return try await self.client.execute(operation: "StopWorkflow", path: "/migrationworkflow/{id}/stop", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Tag a resource by specifying its Amazon Resource Name (ARN).
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> TagResourceResponse {
        return try await self.client.execute(operation: "TagResource", path: "/tags/{resourceArn}", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Deletes the tags for a resource.
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> UntagResourceResponse {
        return try await self.client.execute(operation: "UntagResource", path: "/tags/{resourceArn}", httpMethod: .DELETE, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Update a migration workflow.
    public func updateWorkflow(_ input: UpdateMigrationWorkflowRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> UpdateMigrationWorkflowResponse {
        return try await self.client.execute(operation: "UpdateWorkflow", path: "/migrationworkflow/{id}", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Update a step in a migration workflow.
    public func updateWorkflowStep(_ input: UpdateWorkflowStepRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> UpdateWorkflowStepResponse {
        return try await self.client.execute(operation: "UpdateWorkflowStep", path: "/workflowstep/{id}", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Update the step group in a migration workflow.
    public func updateWorkflowStepGroup(_ input: UpdateWorkflowStepGroupRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> UpdateWorkflowStepGroupResponse {
        return try await self.client.execute(operation: "UpdateWorkflowStepGroup", path: "/workflowstepgroup/{id}", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension MigrationHubOrchestrator {
    ///  List AWS Migration Hub Orchestrator plugins.
    /// Return PaginatorSequence for operation.
    ///
    /// - Parameters:
    ///   - input: Input for request
    ///   - logger: Logger used flot logging
    ///   - eventLoop: EventLoop to run this process on
    public func listPluginsPaginator(
        _ input: ListPluginsRequest,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> AWSClient.PaginatorSequence<ListPluginsRequest, ListPluginsResponse> {
        return .init(
            input: input,
            command: self.listPlugins,
            inputKey: \ListPluginsRequest.nextToken,
            outputKey: \ListPluginsResponse.nextToken,
            logger: logger,
            on: eventLoop
        )
    }

    ///  List the step groups in a template.
    /// Return PaginatorSequence for operation.
    ///
    /// - Parameters:
    ///   - input: Input for request
    ///   - logger: Logger used flot logging
    ///   - eventLoop: EventLoop to run this process on
    public func listTemplateStepGroupsPaginator(
        _ input: ListTemplateStepGroupsRequest,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> AWSClient.PaginatorSequence<ListTemplateStepGroupsRequest, ListTemplateStepGroupsResponse> {
        return .init(
            input: input,
            command: self.listTemplateStepGroups,
            inputKey: \ListTemplateStepGroupsRequest.nextToken,
            outputKey: \ListTemplateStepGroupsResponse.nextToken,
            logger: logger,
            on: eventLoop
        )
    }

    ///  List the steps in a template.
    /// Return PaginatorSequence for operation.
    ///
    /// - Parameters:
    ///   - input: Input for request
    ///   - logger: Logger used flot logging
    ///   - eventLoop: EventLoop to run this process on
    public func listTemplateStepsPaginator(
        _ input: ListTemplateStepsRequest,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> AWSClient.PaginatorSequence<ListTemplateStepsRequest, ListTemplateStepsResponse> {
        return .init(
            input: input,
            command: self.listTemplateSteps,
            inputKey: \ListTemplateStepsRequest.nextToken,
            outputKey: \ListTemplateStepsResponse.nextToken,
            logger: logger,
            on: eventLoop
        )
    }

    ///  List the templates available in Migration Hub Orchestrator to create a migration workflow.
    /// Return PaginatorSequence for operation.
    ///
    /// - Parameters:
    ///   - input: Input for request
    ///   - logger: Logger used flot logging
    ///   - eventLoop: EventLoop to run this process on
    public func listTemplatesPaginator(
        _ input: ListMigrationWorkflowTemplatesRequest,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> AWSClient.PaginatorSequence<ListMigrationWorkflowTemplatesRequest, ListMigrationWorkflowTemplatesResponse> {
        return .init(
            input: input,
            command: self.listTemplates,
            inputKey: \ListMigrationWorkflowTemplatesRequest.nextToken,
            outputKey: \ListMigrationWorkflowTemplatesResponse.nextToken,
            logger: logger,
            on: eventLoop
        )
    }

    ///  List the step groups in a migration workflow.
    /// Return PaginatorSequence for operation.
    ///
    /// - Parameters:
    ///   - input: Input for request
    ///   - logger: Logger used flot logging
    ///   - eventLoop: EventLoop to run this process on
    public func listWorkflowStepGroupsPaginator(
        _ input: ListWorkflowStepGroupsRequest,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> AWSClient.PaginatorSequence<ListWorkflowStepGroupsRequest, ListWorkflowStepGroupsResponse> {
        return .init(
            input: input,
            command: self.listWorkflowStepGroups,
            inputKey: \ListWorkflowStepGroupsRequest.nextToken,
            outputKey: \ListWorkflowStepGroupsResponse.nextToken,
            logger: logger,
            on: eventLoop
        )
    }

    ///  List the steps in a workflow.
    /// Return PaginatorSequence for operation.
    ///
    /// - Parameters:
    ///   - input: Input for request
    ///   - logger: Logger used flot logging
    ///   - eventLoop: EventLoop to run this process on
    public func listWorkflowStepsPaginator(
        _ input: ListWorkflowStepsRequest,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> AWSClient.PaginatorSequence<ListWorkflowStepsRequest, ListWorkflowStepsResponse> {
        return .init(
            input: input,
            command: self.listWorkflowSteps,
            inputKey: \ListWorkflowStepsRequest.nextToken,
            outputKey: \ListWorkflowStepsResponse.nextToken,
            logger: logger,
            on: eventLoop
        )
    }

    ///  List the migration workflows.
    /// Return PaginatorSequence for operation.
    ///
    /// - Parameters:
    ///   - input: Input for request
    ///   - logger: Logger used flot logging
    ///   - eventLoop: EventLoop to run this process on
    public func listWorkflowsPaginator(
        _ input: ListMigrationWorkflowsRequest,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> AWSClient.PaginatorSequence<ListMigrationWorkflowsRequest, ListMigrationWorkflowsResponse> {
        return .init(
            input: input,
            command: self.listWorkflows,
            inputKey: \ListMigrationWorkflowsRequest.nextToken,
            outputKey: \ListMigrationWorkflowsResponse.nextToken,
            logger: logger,
            on: eventLoop
        )
    }
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
